import java.net.DatagramPacket;
import java.net.InetAddress;
import java.util.Date;

public class PSPEvent {
	public static int ID_counter = 0;
	public Date event_time;
	public String event_ID;
	public byte[] event_data;

	
	// Creates an empty packet
	PSPEvent(){		
		event_time = new Date();
		event_ID = Long.toString(ID_counter++);
		event_data = new byte[1024];
	}

	// Creates an event from the given packet 
	PSPEvent(String channel_name, DatagramPacket packet){		
		new PSPEvent();
	}
	
	PSPEvent(String channel_name, byte[] e_data){
		event_ID = channel_name + Long.toString(ID_counter++);
		event_time = new Date();
		event_data = e_data;		
	}
	
	public String getEventInformation(){
		return event_ID + Globals.data_separator + event_time.toString() + Globals.data_separator + new String(event_data);
		
	}
	
}
